<?php
header("content-type:text/html;charset=utf-8");

$db=new mysqli("localhost","root","root","mogujie");

$id=$_POST["id"];
$product_num=$_POST["product_num"];

$sql="UPDATE add_product SET product_num=${product_num} WHERE id=$id";

$flag=$db->query($sql);
if($flag){
    echo '{"ok":true}';
}else{
    echo '{"ok":false}';
}
?>